#ifndef PERLOAD_HELPER_CONSTANTS_H
#define PERLOAD_HELPER_CONSTANTS_H
#include <string>
#include <unordered_map>

namespace {
    constexpr const int ARG_IDX_OPERATION = 1;
    constexpr const int ARG_IDX_PNAME = 2;
    constexpr const int ARG_IDX_FILEPATH_OR_CMDLINE = 3;

    constexpr const int ARG_COUNT_NO_EXTRA_ARGS = 1;
    constexpr const int ARG_COUNT_OPERATION_PNAME = 3;
    constexpr const int ARG_COUNT_OPERATION_PNAME_FILEPATH = 4;

    const std::string OP_PRELOAD = "preload";
    const std::string OP_AWAKEN = "awaken";

    const std::string EXE_NAME_MS_OFFICE_WORD = "winword.exe";
    const std::string EXE_NAME_MS_OFFICE_EXCEL = "excel.exe";
    const std::string EXE_NAME_MS_OFFICE_POWERPOINT = "powerpnt.exe";

    const std::string MAIN_WINDOW_NAME_WORD = "winword";
    const std::string MAIN_WINDOW_NAME_EXCEL = "excel";
    const std::string MAIN_WINDOW_NAME_POWERPOINT = "powerpnt";

    const std::unordered_map<std::string, std::string> PNAME_TO_WINDOW_NAME = {
        {EXE_NAME_MS_OFFICE_WORD, MAIN_WINDOW_NAME_WORD},
        {EXE_NAME_MS_OFFICE_EXCEL, MAIN_WINDOW_NAME_EXCEL},
        {EXE_NAME_MS_OFFICE_POWERPOINT, MAIN_WINDOW_NAME_POWERPOINT},
    };

    typedef enum : int {
        SUCCEED = 0,
        ERROR_ARG_COUNT,
        ERROR_APP_NAME,
        HWND_NOT_FOUND,
        FILE_NOT_FOUND,
        PRELOAD_FAILED,
        UNKNOWN,
    } PreloadHelperErrorCode;
}

#endif // !PERLOAD_HELPER_CONSTANTS_H